package yixuan.entity;

import lombok.Data;

import java.io.Serializable;

@Data
public class QueryParam<T> implements Serializable {

    private static final long serialVersionUID = -5678545045926331587L;

    private static final int MAX_SIZE = 100 ;

    private Integer pageNo = 1 ;

    private Integer pageSize = 20 ;

    private Long timestamp ;

    private T param;


    public Integer getPageSize() {
        return pageSize <= MAX_SIZE? pageSize:MAX_SIZE;
    }

    public Long getTimestamp() {
        return timestamp != null?timestamp:System.currentTimeMillis();
    }
}
